<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout" layout:decorate="~{layouts/main}">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .text_red {
            color: #FA0004;
        }
    </style>
</head>
<body>
<div layout:fragment="content" style="margin-left: 10%;margin-top: 20px">
    <form method="post" id="goodsForm" th:action="@{/goods/updateIsCheck}" th:object="${goods}">
        <input hidden th:field="*{id}" id="id">
    <div class="layui-row">
        <div class="layui-col-xs8">
            <div class="layui-form-item">
                <label class="layui-form-label">商品名称</label>
                <div class="layui-input-block">
                    <input type="text" th:field="*{name}" lay-verify="title" autocomplete="off" disabled class="layui-input">
                </div>
            </div>
        </div>
    </div>
    <div class="layui-row">
        <div class="layui-col-xs8">
            <div class="layui-form-item">
                <label class="layui-form-label">商品价格</label>
                <div class="layui-input-block">
                    <input type="text" th:field="*{price}" lay-verify="title" autocomplete="off" disabled class="layui-input">
                </div>
            </div>
        </div>
    </div>
    <div class="layui-row">
        <div class="layui-col-xs8">
            <div class="layui-form-item">
                <label class="layui-form-label">商品介绍</label>
                <div class="layui-input-block">
                    <input type="text" th:field="*{remarks}" lay-verify="title" autocomplete="off" disabled class="layui-input">
                </div>
            </div>
        </div>
    </div>
    <div class="layui-row">
        <div class="layui-col-xs8">
            <div class="layui-form-item">
                <label class="layui-form-label">发布位置</label>
                <div class="layui-input-block">
                    <div class="layui-input-inline">
                        <span th:text="*{houseProvince}"></span>
                        <span th:text="*{houseCity}"></span>
                        <span th:text="*{houseDistrict}"></span>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="layui-row">
        <div class="layui-col-xs8">
            <div class="layui-form-item">
                <label class="layui-form-label">商品图片</label>
                <div class="layui-input-block">
                    <div class="layui-inline">
                        <img id="image" style="padding-bottom: 5px" width="120px" height="100px" th:src="'http://qpmz3m7m0.hd-bkt.clouddn.com/'+${goods.photo}">
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="layui-row">
        <div class="layui-col-xs8">
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button type="button" class="layui-btn" th:if="${T(com.spring.cold.security.Securitys).getIsAdmin() eq '1'}" onclick="review()">审核</button>
                    <button type="button" class="layui-btn" onclick="layer_close()">关闭</button>
                </div>
            </div>
        </div>
    </div>
    </form>
</div>
</body>
<th:block layout:fragment="pageScripts">
    <script th:src="@{/customize/js/city.js}"></script>
    <script th:src="@{/customize/js/method.js}"></script>
    <script th:inline="javascript">
        function review() {
            $.ajax({
                type: "POST",
                url: $('form').attr('action'),
                data: {id:$("#id").val()},
                success: function (result) {
                    layer.alert(result.msg, {
                        skin: 'layui-layer-molv'
                        , closeBtn: 0
                    }, function(){parent.window.location.reload();})
                }
            });
        }
    </script>
</th:block>
</html>